var tyupoo = {};

tyupoo.besideTip = new function(){
	var tip = Pmoo.Tip2.factory({'type':'Beside', 'height':50, 'classname':'tyupoo_box tyupoo_tips'});
	
	var closeHtml = [
		'<a href="#" title="close" onclick="Pmoo.Tip2.close(\'',
		tip.ID,
		'\');return false;">X</a>'].join('');
	
	/**
	 * 显示loading提示
	 * @param {Sting} content 提示内容
	 */	
	this.showLoading = function(el,content){
		tip.set(
			'<div class="tyupoo_box_head">',
			'<h4>loading...</h4>',
			closeHtml,
			'</div><div class="tyupoo_box_body"><p>',
			content,
			'</p>',
			'</div>'
		).show(el);		
	};
	
	/**
	 * 显示提示
	 * @param {String} content 提示内容
	 * @param {Int} delay 隐藏延时
	 */
	this.show = function(el,content,delay){
		tip.set(
			'<div class="tyupoo_box_head">',
			'<h4>Yupoo!</h4>',
			closeHtml,
			'</div><div class="tyupoo_box_body"><p>',
			content,
			'</p>',
			'</div>'
		).show(el,{'hidelay':delay});		
	};
	
	/**
	 * 隐藏提示
	 */
	this.hide = function(){
		tip.hide();
	};	
};

tyupoo.centerFrame = new function(){
	var tip = Pmoo.Tip2.factory({'type':'Center', 'height':320, 'width':400, 'classname':'tyupoo_box tyupoo_frame'});
	
	var closeHtml = [
		'<a href="#" title="close" onclick="tyupoo.centerFrame.hide();return false;">X</a>'].join('');
	
	this.show = function(url){
		Pmoo.Mask.show();
		tip.set(
			'<div class="tyupoo_box_head">',
			'<h4>Yupoo!</h4>',
			closeHtml,
			'</div><div class="tyupoo_box_body">',
			'<iframe width="100%" height="300px" scrolling="no" frameborder="0" src="',
			url,
			'"></iframe>',
			'</div>'	
		).show();
	};
	
	this.hide = function(){
		tip.hide();
		Pmoo.Mask.hide();
	};
};

